package com.type;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

public class Person extends Photo {
	private long phoneNumber;

	public Person() {
		super();
	}
	
	public Person(long phoneNumber, Bitmap bitmap) {
		super(bitmap);
		this.phoneNumber = phoneNumber;
	}
	
	public long getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(long phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	
	@Override
	public void receive(DataInputStream dis) throws IOException, InterruptedException {
		super.receive(dis);
		phoneNumber = dis.readLong();
	}

	@Override
	public void send(DataOutputStream dos) throws IOException, InterruptedException {
		super.send(dos);
		dos.writeLong(phoneNumber);
	}
	
	
	public Person(Parcel in) {
		super(in);
		phoneNumber = in.readLong();
	}
	
	public static final Parcelable.Creator<Person> CREATOR = new Parcelable.Creator<Person>() {
		public Person createFromParcel(Parcel in) {
			return new Person(in);
		}

		@Override
		public Person[] newArray(int size) {
			return new Person[size];
		}
	};

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel out, int flags) {
		super.writeToParcel(out, flags);
		out.writeLong(phoneNumber);
	}
}